package com.xci.platform.web.configuration;

import org.springframework.cache.Cache;
import org.springframework.cache.CacheManager;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import javax.annotation.Resource;

@Configuration
public class CacheBeanConfiguration {

    @Resource
    private CacheManager cacheManager;

    @Bean(name = "paramCache")
    public Cache paramCache() {
        return cacheManager.getCache("paramCache");
    }

    @Bean(name = "contentCache")
    public Cache contentCache() {
        return cacheManager.getCache("contentCache");
    }

    @Bean(name = "onlineUserCache")
    public Cache onlineUserCache() {
        return cacheManager.getCache("onlineUserCache");
    }

    @Bean(name = "userPermissionCache")
    public Cache userPermissionCache() {
        return cacheManager.getCache("userPermissionCache");
    }
}
